package com.aier.entrance.icsocket;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

import net.eicp.ghostboy.futil.web.BeanFactory;

import com.aier.common.common.Constant;
import com.aier.entrance.service.IEntranceCardService;



public class EntranceSocket extends Thread{

    @Override
    public void run() {
        IEntranceCardService ec=(IEntranceCardService)BeanFactory.getBean("entranceCardService");
        
        try {
            ServerSocket ss = new ServerSocket(Constant.num_8000);
            Socket s;
            while(true){
                s = ss.accept();
                EntranceSendCommand send = new EntranceSendCommand(s, null, null, Constant.num_8000, ec);
                //开辟一个线程来读取
                send.new receiveMsgFromDev(s);
                //receiveMsgFromDev rmfd = send.new receiveMsgFromDev(s);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }    
        
    }
}
